﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Studio77_SuperLink_Views="clr-namespace:Studio77.SuperLink.Views" 
    xmlns:UI="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" 
    x:Class="Studio77.SuperLink.Pages.GamePage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False" >
    <phone:PhoneApplicationPage.Resources>
        <ControlTemplate x:Key="PhoneProgressBarSliderThumb" TargetType="Thumb">
            <Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4"/>
        </ControlTemplate>
        <Style x:Key="PhoneProgressBarSliderStyle" TargetType="Slider">
            <Setter Property="Maximum" Value="3000"/>
            <Setter Property="Minimum" Value="0"/>
            <Setter Property="Value" Value="0"/>
            <Setter Property="Opacity" Value="0"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Slider">
                        <Grid IsHitTestVisible="False">
                            <Grid x:Name="HorizontalTemplate">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0" Height="0" Template="{x:Null}"/>
                                <Thumb x:Name="HorizontalThumb" Grid.Column="1" Foreground="{TemplateBinding Foreground}" Height="4" IsTabStop="False" Template="{StaticResource PhoneProgressBarSliderThumb}"/>
                                <RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2" Height="0" Template="{x:Null}"/>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ProgressBarStyle1" TargetType="ProgressBar">
            <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
            <Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
            <Setter Property="Maximum" Value="100"/>
            <Setter Property="IsHitTestVisible" Value="False"/>
            <Setter Property="Padding" Value="{StaticResource PhoneHorizontalMargin}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ProgressBar">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Determinate"/>
                                    <VisualState x:Name="Indeterminate">
                                        <Storyboard Duration="00:00:04.4" RepeatBehavior="Forever">
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateRoot">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeterminateRoot">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider1">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                                <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider2">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                                <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider3">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                                <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider4">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                                <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider5">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                                <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider1">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider2">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider3">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider4">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider5">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="DeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Visible">
                                <Rectangle x:Name="ProgressBarTrack" Margin="0,5" Stroke="#FF6A6A6A" StrokeThickness="0.5" RadiusX="5" RadiusY="5">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF706C6C" Offset="0"/>
                                            <GradientStop Color="#FFC8C8C8" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Margin="2,7" RadiusX="5" RadiusY="5" />
                            </Grid>
                            <Border x:Name="IndeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Collapsed">
                                <Grid>
                                    <Slider x:Name="Slider1" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                    <Slider x:Name="Slider2" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                    <Slider x:Name="Slider3" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                    <Slider x:Name="Slider4" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                    <Slider x:Name="Slider5" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                </Grid>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleFinder" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Studio77.SuperLink;component/Images/finder.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleReArrange" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Studio77.SuperLink;component/Images/rearrange.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleClock" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Studio77.SuperLink;component/Images/clock.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Name="StoryboardGameCanvasIn">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="gameCanvas">
                <EasingDoubleKeyFrame KeyTime="0" Value="-500"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="1"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardTopBarIn">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="gridTopBar">
                <EasingDoubleKeyFrame KeyTime="0" Value="-80"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style x:Key="ButtonStyleNextStage" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/btnNextStage.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleRestart" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/btnRestart.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleReturnMenu" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/btnReturnMenu.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleContinueGame" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/btnContinueGame.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleTryAgain" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/btnTryAgain.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Name="StoryboardShowPause">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="gridPause">
                <EasingDoubleKeyFrame KeyTime="0" Value="-800"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseOut" Bounciness="5"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardHidePause">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="gridPause">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-800">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardShowLose">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="gridLose">
                <EasingDoubleKeyFrame KeyTime="0" Value="480"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseOut" Bounces="2" Bounciness="5"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardHideLose">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="gridLose">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="480">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <SineEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardShowWin">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="gridWin">
                <EasingDoubleKeyFrame KeyTime="0" Value="-480"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseOut" Bounces="2" Bounciness="5"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardHideWin">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="gridWin">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-480">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <SineEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardStarAction">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="stackStar">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="stackStar">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>

    <!--演示 ApplicationBar 用法的示例代码-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="按钮 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="按钮 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="菜单项 1"/>
                <shell:ApplicationBarMenuItem Text="菜单项 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Viewbox>

        <Grid x:Name="LayoutRoot" Background="Transparent" Height="800" Width="480">
            <Grid.RowDefinitions>
                <RowDefinition Height="69"/>
                <RowDefinition/>
                <RowDefinition Height="70"/>
            </Grid.RowDefinitions>

            <!--TitlePanel 包含应用程序的名称和页标题-->

            <Image Grid.RowSpan="3" Source="/Studio77.SuperLink;component/Images/maingb.jpg" Stretch="None" d:IsLocked="True"/>
            <Border BorderBrush="Black" BorderThickness="1" Margin="0" Grid.RowSpan="3" Background="White" Opacity="0.6"/>

            <!--ContentPanel - 在此处放置其他内容-->
            <Border BorderThickness="0" Grid.Row="2" Background="#33000000">
                <Image Source="/Studio77.SuperLink;component/Images/logo77.png" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Height="37" Width="131"/>
            </Border>
            <Studio77_SuperLink_Views:LinkGameCanvas x:Name="gameCanvas" Grid.Row="1" Width="420" Height="630" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                <Studio77_SuperLink_Views:LinkGameCanvas.RenderTransform>
                    <CompositeTransform/>
                </Studio77_SuperLink_Views:LinkGameCanvas.RenderTransform>
            </Studio77_SuperLink_Views:LinkGameCanvas>
            <Grid x:Name="gridWin" Grid.Row="1" Width="330" Height="454" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <CompositeTransform TranslateX="-480"/>
                </Grid.RenderTransform>
                <Border BorderBrush="#FFD97E00" BorderThickness="8" Margin="0,56,0,0" CornerRadius="20" Background="#FFFFFEAB"/>
                <Image Height="128" Source="/Images/winface.png" Stretch="Fill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="128" Margin="10,0,0,0"/>
                <Image Margin="109,29,23,0" Source="/Images/winText.png" Stretch="Fill" Height="83" VerticalAlignment="Top"/>
                <StackPanel x:Name="stackStar" HorizontalAlignment="Center" Margin="0,140,0,0" VerticalAlignment="Top" Orientation="Horizontal" d:LayoutOverrides="VerticalAlignment" RenderTransformOrigin="0.5,0.5">
                    <StackPanel.RenderTransform>
                        <CompositeTransform/>
                    </StackPanel.RenderTransform>
                    <Image Source="/Images/star.png" Stretch="Fill" Width="80" Height="80"/>
                    <Image Source="/Images/star.png" Stretch="Fill" Width="80" Height="80"/>
                    <Image Source="/Images/star.png" Stretch="Fill" Width="80" Height="80"/>
                </StackPanel>
                <StackPanel Margin="71,0,70,25" Orientation="Vertical" VerticalAlignment="Bottom">
                    <Button x:Name="btnNextStage" Content="Button" Height="51" Margin="0,10,0,0" Style="{StaticResource ButtonStyleNextStage}" Click="NextStage_Click"/>
                    <Button Content="Button" HorizontalAlignment="Center" Height="51" Margin="0,10,0,0" Style="{StaticResource ButtonStyleRestart}" Width="189" Click="Restart_Click"/>
                    <Button Content="Button" HorizontalAlignment="Center" Height="52" Margin="0,10,0,0" Style="{StaticResource ButtonStyleReturnMenu}" Width="188" Click="ReturnMenu_Click"/>
                </StackPanel>
            </Grid>
            <Grid x:Name="gridPause" Grid.Row="1" Width="330" Height="329" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <CompositeTransform TranslateY="-800"/>
                </Grid.RenderTransform>
                <Border BorderBrush="#FFD97E00" BorderThickness="8" Margin="0,56,0,0" CornerRadius="20" Background="#FFFFFEAB"/>
                <Image Height="128" Source="/Images/pauseface.png" Stretch="Fill" VerticalAlignment="Top" HorizontalAlignment="Left" Width="128" Margin="10,0,0,0"/>
                <StackPanel Margin="71,0,70,25" Orientation="Vertical" VerticalAlignment="Bottom">
                    <Button Content="Button" Height="51" Margin="0,10,-1,0" Style="{StaticResource ButtonStyleContinueGame}" Click="Continue_Click"/>
                    <Button Content="Button" HorizontalAlignment="Center" Height="51" Margin="0,10,0,0" Style="{StaticResource ButtonStyleRestart}" Width="189" Click="Restart_Click"/>
                    <Button Content="Button" HorizontalAlignment="Center" Height="52" Margin="0,10,0,0" Style="{StaticResource ButtonStyleReturnMenu}" Width="188" Click="ReturnMenu_Click"/>
                </StackPanel>
                <Image Height="88" Margin="138,26,21,0" Source="/Images/pauseText.png" Stretch="Fill" VerticalAlignment="Top"/>
            </Grid>
            <Grid x:Name="gridLose" Grid.Row="1" Width="330" Height="331" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <CompositeTransform TranslateX="480"/>
                </Grid.RenderTransform>
                <Border BorderBrush="#FFD97E00" BorderThickness="8" Margin="0,56,0,0" CornerRadius="20" Background="#FFFFFEAB"/>
                <Image Height="128" Source="/Images/loseface.png" VerticalAlignment="Top" HorizontalAlignment="Left" Width="128" Margin="10,0,0,0" Stretch="Fill"/>
                <StackPanel Margin="71,0,70,25" Orientation="Vertical" VerticalAlignment="Bottom">
                    <Button Content="Button" Height="51" Margin="0" Style="{StaticResource ButtonStyleTryAgain}" Click="Restart_Click"/>
                    <Button Content="Button" HorizontalAlignment="Center" Height="52" Margin="0,10,0,0" Style="{StaticResource ButtonStyleReturnMenu}" Width="188" Click="ReturnMenu_Click"/>
                </StackPanel>
                <Image Height="86" Margin="75,16,12,0" Source="/Images/loseText.png" Stretch="Fill" VerticalAlignment="Top"/>
            </Grid>
            <Grid x:Name="gridTopBar" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <CompositeTransform/>
                </Grid.RenderTransform>
                <Image Source="/Studio77.SuperLink;component/Images/wood.jpg" Stretch="Fill" Opacity="0.8" d:IsLocked="True"/>
                <Border CornerRadius="20" BorderThickness="1" BorderBrush="#FF414141" Width="242" HorizontalAlignment="Left" Margin="10,14,0,15" >
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF999999" Offset="0"/>
                            <GradientStop Color="#FF4D4D4D" Offset="1"/>
                            <GradientStop Color="Silver" Offset="0.289"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <ProgressBar x:Name="gameProcess" BorderBrush="White" Value="100" Style="{StaticResource ProgressBarStyle1}" Background="White" SmallChange="1" d:IsLocked="True">
                        <ProgressBar.Foreground>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFF9800" Offset="0.004"/>
                                <GradientStop Color="#FF6E0000" Offset="1"/>
                            </LinearGradientBrush>
                        </ProgressBar.Foreground>
                    </ProgressBar>

                </Border>
                <Button Click="btnFinder_Click" x:Name="btnFinder" Content="Button" HorizontalAlignment="Right" Height="56" Margin="0,5,172,8" Style="{StaticResource ButtonStyleFinder}" Width="56"/>
                <Button x:Name="btnClock" Content="Button" HorizontalAlignment="Right" Margin="0,5,19,8" Style="{StaticResource ButtonStyleClock}" Width="56" Click="btnClock_Click"/>
                <Button x:Name="btnReArrange" Click="btnReArrange_Click" Content="Button" HorizontalAlignment="Right" Margin="0,5,94,8" Style="{StaticResource ButtonStyleReArrange}" Width="56"/>
                <TextBlock x:Name="txtFinderCount" HorizontalAlignment="Left" Margin="304,31,0,8" TextWrapping="Wrap" Text="99" Width="22"/>
                <TextBlock x:Name="txtArrangeCount" HorizontalAlignment="Left" Margin="380,31,0,8" TextWrapping="Wrap" Text="99" Width="22"/>
                <TextBlock x:Name="txtColckCount" HorizontalAlignment="Left" Margin="455,31,0,8" TextWrapping="Wrap" Text="99" Width="22"/>

            </Grid>
            <Grid Grid.Row="2" x:Name="bottomAD">
                <Image x:Name="imgBanner" Margin="0,-10,0,0" Source="/Images/banner1.jpg" Stretch="Fill" Width="480" Height="80" VerticalAlignment="Bottom" Tap="imgBanner_Tap"/>
                <UI:AdControl ApplicationId="0e8670d2-0357-4a77-8e07-97ee65857834" AdUnitId="152946" HorizontalAlignment="Left" Height="80" VerticalAlignment="Top" Width="480" Margin="0,-10,0,0"/>
            </Grid>
        </Grid>

    </Viewbox>

</phone:PhoneApplicationPage>
